package com.bestcem.xm.member.dao;

import com.bestcem.xm.member.entity.mongo.BaseEntity;

/**
 * @author ming.xue <ming.xue@idiaoyan.com>
 * @desc 通用数据访问
 * @date 2021-07-24
 */
public interface CommonDao {
    /**
     * 根据主键获取实体类
     *
     * @param id
     * @param entityClass
     * @return
     */
    <T extends BaseEntity> T get(String id, Class<T> entityClass);

    /**
     * 插入
     *
     * @param objectToSave
     */
    <T extends BaseEntity> T insert(T objectToSave);

    /**
     * 保存
     *
     * @param objectToSave
     * @param <T>
     * @return
     */
    <T extends BaseEntity> T save(T objectToSave);
}
